package com.lonelyzhe.springboot.service.impl;

import com.lonelyzhe.springboot.bean.Book;
import com.lonelyzhe.springboot.mapper.BookMapper;
import com.lonelyzhe.springboot.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookService implements IBookService {
    @Autowired
    private BookMapper bookMapper;

    @Override
    public List<Book> selectAllBookList() {
        return bookMapper.getAllBookList();
    }

    @Override
    public List<Book> selectBookList(int category_id) {
        return bookMapper.getBookList(category_id);
    }

    @Override
    public void insertBook(Book book) {
        bookMapper.insertBook(book);
    }

    @Override
    public void updateBook(Book book) {
        bookMapper.updateBook(book);
    }

    @Override
    public void deleteBook(int book_id) {
        bookMapper.deleteBook(book_id);
    }
}
